import os
import pandas as pd
import zipfile
import numpy as np
import shutil
from pandas import DataFrame, Series

import tools

pd.set_option('display.unicode.east_asian_width', True)

base_path = r"D:\100-Project\2024-2025-1学期安排\武昌首义学院\29101303_《通信数据运维技术实训（企业）》\学生提交"

df0 = pd.read_excel(base_path + r"\报告\《数据运维实训》报告提交记录.xlsx")
df0 = df0[['学号', '姓名']]
# print(df0)

# 使用 iterrows() 遍历行
for index, row in df0.iterrows():
    # print(row['学号'], row['姓名'])
    dir_path =base_path + r"\项目代码\\" + "{}_{}".format(row['学号'], row['姓名'])
    if not os.path.exists(dir_path):
        os.makedirs(dir_path)
    else:
        print("Folder already exists")

    shutil.copy(r"D:\100-Project\2024-2025-1学期安排\武昌首义学院\29101303_《通信数据运维技术实训（企业）》\教学资料\ansible-roles-examples.tar.gz", dir_path)